package cn.imvc.app.domains;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

//订单类型 ：11总订单12仓库订单13商品订单
//21充值订单22提现订单
//31分销商升级订单
public enum OrderType {
    Order(11) {
        public String toString() {
            return "总订单";
        }
    },
    Storage(12) {
        public String toString() {
            return "仓库订单";
        }
    },
    Goods(13) {
        public String toString() {
            return "商品订单";
        }
    },
    Recharge(21) {
        public String toString() {
            return "充值订单";
        }
    },
    Withdrawals(22) {
        public String toString() {
            return "提现订单";
        }
    },
    Upgrade(31) {
        public String toString() { return "分销商升级订单"; }
    };

    private final String val;

    OrderType(int n) {
        val =String.valueOf(n);
    }

    public String getValue() {
        return val;
    }
    public static OrderType getByIntValue(int n) {
        switch (n) {
            case 11:
                return Order;
            case 12:
                return Storage;
            case 13:
                return Goods;
            case 21:
                return Recharge;
            case 22:
                return Withdrawals;
            case 31:
                return Upgrade;
           
            default:
                return null;
        }
    }
    
    public static final Map<String, String> elMap = new LinkedHashMap<String, String>();  
	  
    static {  
        for (OrderType s : EnumSet.allOf(OrderType.class)) {  
        	elMap.put(s.getValue(), s.toString());  
        }  
    }
}